# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-yaml
_pkgname=PyYAML
pkgver=6.0
pkgrel=0
pkgdesc="Python3 bindings for YAML"
url="https://pyyaml.org/"
arch="all"
license="MIT"
depends="python3"
makedepends="python3-dev yaml-dev cython py3-setuptools"
source="$_pkgname-$pkgver.tar.gz::https://github.com/yaml/pyyaml/archive/$pkgver.tar.gz"
builddir="$srcdir/pyyaml-$pkgver"

replaces="py-yaml" # Backwards compatibility
provides="py-yaml=$pkgver-r$pkgrel" # Backwards compatibility

# secfixes:
#   5.4-r0:
#     - CVE-2020-14343
#   5.3.1-r0:
#     - CVE-2020-1747

prepare() {
	default_prepare
	rm -f ext/_yaml.c
}

build() {
	python3 setup.py --with-libyaml build
}

check() {
	python3 setup.py test
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="
cbcacc3560a035e2082867e93a9733f8660ea4c7f60573d07642f33a5453dcdc88d67299c3bcb97c27b843202a45d40de7444eb5e815bd4955129c9fc8ae04ad  PyYAML-6.0.tar.gz
"
